package com.zzyl.mapper;

import com.zzyl.base.addAndUpdateBedDto;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);

    @Insert("insert into bed   (bed_number,sort,room_id,bed_status,create_time,create_by) values (#{bedNumber},#{sort},#{roomId},#{bedStatus},#{createTime},#{createBy})")
    void addBed(addAndUpdateBedDto dto);

    @Select("select * from bed where id=#{id}")
    BedVo getBedById(Integer id);
    @Update("update bed set bed_number=#{bedNumber}, room_id=#{roomId},sort=#{sort} where id=#{id}")
    void updateBedById(addAndUpdateBedDto dto);
    @Delete("delete from  bed where id=${id}")
    void deleteBedById(Integer id);
}

